package com.hakim.wfb.customer.enums;

/**
 * 用户状态 1-激活，2-冻结 3-销户
 * Created by zhoubing on 2016/3/7.
 */
public enum CustomerStatus {
    /**
     * 0, 正常
     */
    NORMAL(0, "正常"),
    /**
     * 1, 冻结
     */
    FROZEN(1, "冻结"),
    /**
     * 2, 注销
     */
    SUSPENDED(2, "注销");


    /**
     * 值
     */
    private int code;
    /**
     * 注释
     */
    private String message;

    private CustomerStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static CustomerStatus getByCode(int code) {
        for (CustomerStatus type : values()) {
            if (type.getCode() == (code)) {
                return type;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
